import { createApp } from 'vue';
import App from './App.vue';
import '@/styles/index.scss';
/** 引入element-plus */
import ElementPlus from 'element-plus';

import 'element-plus/dist/index.css';
//@ts-ignore忽略当前文件ts类型的检测否则有红色提示(打包会失败)
import zhCn from 'element-plus/dist/locale/zh-cn.mjs';
// 引入element-plus图标
import * as ElementPlusIconsVue from '@element-plus/icons-vue';
/** 引入svg图标 */
import 'virtual:svg-icons-register';
/** 引入自定义插件对象：注册整个项目全局全局组件 */
import globalComponent from '@/components';
// 导入路由文件
import router from './router';
// 引入store
import store from './store';

const app = createApp(App);

//安装自定义插件
app.use(router);
app.use(store);
app.use(globalComponent);
app.use(ElementPlus, {
	locale: zhCn
});
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
	app.component(key, component);
}
app.mount('#app');
